package com.lottery.api;

import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.bind.annotation.CrossOrigin;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

@EnableScheduling
@EnableSwagger2
@MapperScan({"com.lottery.common.dao*"})
@SpringBootApplication(scanBasePackages={"com.lottery"},exclude = DruidDataSourceAutoConfigure.class)
//@CrossOrigin(origins = "http://192.168.101.4", maxAge = 3600)
public class LotteryApiApplication extends SpringBootServletInitializer {

//    @Override
//    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
//         //注意这里要指向原先用main方法执行的Application启动类
//        return builder.sources(LotteryApiApplication.class);
//    }

    public static void main(String[] args) {
        SpringApplication.run(LotteryApiApplication.class, args);
    }

}
